package org.su.webadapter.validate;

import javax.validation.constraints.Size;

/**
 * Created by yangchuan on 15/12/22.
 */
public class SizeValidator implements IValidator {
    @Override
    public String validate(Object values,Object object){
        Size size = (Size)object;
        String obj = (String)values;
        return  (values == null || ( obj.length() > size.min()  && obj.length()  < size.max())) ?  null : size.message();
    }
}
